package org.exeed.controller;

import org.exeed.aop.tag.Auth;
import org.exeed.bean.ResultBean;
import org.exeed.entity.PageSketchEntity;
import org.exeed.service.PageHistoryService;
import org.exeed.service.PageService;
import org.exeed.service.PageSketchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//@CrossOrigin
@RestController
@RequestMapping("history")
public class PageHistoryController {


    @Autowired
    private PageHistoryService pageHistoryService;

    @Auth
    @GetMapping("/selectPages")
    public ResultBean selectPages(@RequestParam("page") Integer page, @RequestParam("size") Integer size, @RequestParam("sourceId") Long sourceId) {
        return ResultBean.succeed(pageHistoryService.selectList(page, size, sourceId));
    }

    @Auth
    @GetMapping("/getPageById")
    public ResultBean getById(@RequestParam("id") Long id) {
        return ResultBean.succeed(pageHistoryService.selectById(id));
    }


}
